package org.dtrd.modules.service.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.service.entity.bean.ServiceDetail;

import java.util.Date;


/**
 * <p>
 * 服务套餐信息
 * </p>
 *
 * @author QR
 * @since 2021-11-19 18:52:54
 */
@Data
@TableName("dtrd_ent_rd_service")
public class DtrdEntRdService {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 服务名称
     */
    private String serviceName;

    /**
     * 服务分类id
     */
    private Integer serviceCategoryId;

    /**
     * 品牌/设备
     */
    private String serviceBrand;

    /**
     * 服务价格
     */
    private Float servicePrice;

    /**
     * 服务折扣价
     */
    private Float serviceDiscount;

    /**
     * 服务照片链接, 多个照片用 |分隔
     */
    private String servicePhoto;

    /**
     * 服务描述
     */
    private String serviceDesc;

    /**
     * 执行角色ids
     */
    private String executorIds;

    /**
     * 所属机构编码
     */
    private String orgCode;

    private Date createTime;

    private Date updateTime;

    @TableLogic
    private Integer isDel;

    public DtrdEntRdService init() {
        isDel = 0;
        createTime = new Date();
        updateTime = new Date();
        return this;
    }

    public DtrdEntRdService parseFromDto(ServiceDetail dto) {
        dataId = dto.getDataId();
        serviceName = dto.getServiceName();
        serviceCategoryId = dto.getServiceCategoryId();
        serviceBrand = dto.getServiceBrand();
        servicePrice = dto.getServicePrice();
        serviceDiscount = dto.getServiceDiscount();
        servicePhoto = dto.getServicePhoto();
        serviceDesc = dto.getServiceDesc();
        executorIds = dto.getExecutorIds();
        orgCode = dto.getOrgCode();
        return this;
    }


}
